package com.inspur.sc.springboot.vo;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.inspur.sc.springboot.entity.SysRole;
import lombok.Data;

import java.util.List;

@Data
public class SysGroupVO {

    private Integer id;

    /**
     * 权限组名称
     */
    private String groupName;

    /**
     * 权限组描述
     */
    private String description;

    /**
     *
     */
    private JSONArray roles;


    public void setRoles(JSONArray roles) {
        this.roles = roles;
    }

    public void setRoles(List<SysRole> roles) {
        JSONArray result=new JSONArray();
        roles.forEach(role->{
            result.add(role.getId());
        });
        this.roles = result;
    }
}
